package thread;

public class ThreadDemo {
    public static void main(String[] args) {
        Thread t1 = new MyThread1();
        Thread t2 = new MyThread2();
        Thread t3 = new MyThread3();
        t1.start();
        System.out.println(123);
        t2.start();
        t3.start();

        System.out.println("程序结束"+ Thread.currentThread());
        System.out.println("真的结束了吗");
    }
}

class MyThread1 extends Thread {
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("3" + i);
        }
    }
}

class MyThread2 extends Thread {
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("2" + i);
        }
    }
}

class MyThread3 extends Thread{
    public void run(){
        for (int i = 0; i < 1000; i++){
            System.out.println("1" + i);
        }
    }
}